inspector: allow object read-only properties in prop-editor
authorChristian Hergert <christian@hergert.me>
Tue, 5 May 2015 19:19:10 +0000 (12:19 -0700)
committerChristian Hergert <christian@hergert.me>
Wed, 6 May 2015 05:00:54 +0000 (22:00 -0700)
If we have a GObject property that is also a GObject, we should be able
to view additional information on that object (even if the param spec
is read-only).

gtk/inspector/prop-editor.c

index 8a28539114b9ba2c0f43dd7256eb7b24903dd576..dd17bd4be6c77b0ebcb05c250f94ccd4a85074c9 100644 (file)
@@ -1592,6 +1592,14 @@ constructed (GObject *object)
   can_modify = ((spec->flags & G_PARAM_WRITABLE) != 0 &&
                 (spec->flags & G_PARAM_CONSTRUCT_ONLY) == 0);
 
+  /*
+   * By reaching this, we already know the property is readable.
+   * Since all we can do for a GObject is dive down into it's properties and
+   * inspect bindings and such, pretend to be mutable.
+   */
+  if (g_type_is_a (spec->value_type, G_TYPE_OBJECT))
+    can_modify = TRUE;
+
   if (!can_modify)
     return;